<template>
	<div class="home">
		<cmd-nav-bar iconOne="menu" back left-text="健康提醒"></cmd-nav-bar>
		<div class="not_thing"></div>
		<view class="box">
			<calendar :date="date" :lunar="false" :disable-before="true" :start-date="'2019-4-26'" :end-date="'2019-10-20'"
			 @change="change" @to-click="toClick" :fixedHeihgt="true" />
		</view>
		<uni-card title="医院免疫" thumbnail="../../../static/myimg/zhen.png" note="2019-05-05">
			到医院进行第三次免疫
		</uni-card>
		<uni-card title="洗澡" thumbnail="../../../static/myimg/xizao.png" note="2019-04-29">
			狗狗洗澡
		</uni-card>
		<div class="add_title">添加提醒</div>
		<div style="width:100%;" @click="showModal" data-target="Image">
			<img src="../../../static/myimg/remind.png" alt="">
		</div>
		
		
		<view class="cu-modal" :class="modalName=='Image'?'show':''">
			<view class="cu-dialog">
				<view class="cu-form-group align-start">
					<textarea maxlength="5" @input="textareaBInput" placeholder="请输入备注..." style="text-align: left;"></textarea>
				</view>
				<view class="cu-bar bg-white">
					<view class="action text-green" @tap="hideModal">确定</view>
					<view class="action text-blue" @tap="hideModal">取消</view>
				</view>
			</view>
		</view>
		<!-- <div class="box_add" v-for="n in 10">
			<div class="icontext">
				<div class="icon_box">
					<img src="" alt="">
				</div>
				<div class="text_box">
					<div class="name">
						免疫
					</div>
					<div class="name fonts">
						按时免疫
					</div>
				</div>
			</div>
		</div> -->
	</div>
</template>
<script>
	import cmdNavBar from "@/components/cmd-nav-bar/cmd-nav-bar.vue"
	import calendar from "@/components/uni-calendar/uni-calendar"
	import uniCard from "@/components/uni-card/uni-card.vue"
	export default {
		props: {},
		components: {
			cmdNavBar,
			calendar,
			uniCard
		},
		data() {
			return {
				date: '2019-04-26',
				modalName: null,

			}
		},
		methods: {
			change(e) {
				console.log(e);
			},
			showModal(e) {
				this.modalName = e.currentTarget.dataset.target
			},
			hideModal(e) {
				this.modalName = null
			},
			toClick(e) {
				console.log(e);
			},
			toadd() {
				uni.navigateTo({
					url: 'addremind',
				});
			}
		},
		watch: {},

		onReachBottom() { //页面上拉触底事件的处理函数

		},
		onPullDownRefresh() { //监听用户下拉动作，一般用于下拉刷新
			//需要在 pages.json 里，找到的当前页面的pages节点，并在 style 选项中开启 enablePullDownRefresh
			//uni.startPullDownRefresh(); 开启
			// uni.stopPullDownRefresh(); 关闭
		},
		onUnload() { //监听页面卸载

		},
		onHide() { //监听页面隐藏

		},
		onLoad() { // 替代 created 监听页面加载，其参数为上个页面传递的数据，参数类型为Object（用于页面传参），参考示例

		},
		onReady() { //替代 mounted 监听页面初次渲染完成

		},

		onShow() { //监听页面显示
			//生命周期
		}
	}
</script>
<style scoped>
	.home {
		width: 100%;
		height: 100%;
	}

	.not_thing {
		width: 100%;
		height: 14vw;
		background: #f8f8f8;
	}

	.add_title {
		width: 100%;
		height: 10vw;
		line-height: 10vw;
		padding: 0px 15px;
		font-weight: bold;
		background: white;
	}
	img{
		width: 100%;
	}
.fonts{
	color:gray;
	font-size: 10px;
}
	.name {
		width: 100%;
		height: 50%;
		line-height: 6vw;
	}

	.box_add {
		width: 100%;
		height: 15vw;
		border-top: 1px solid #ededed;
		background: white;
	}

	.icontext {
		width: 90%;
		height: 80%;
		margin-top: 1%;
		margin-left: 5%;
	}

	.icon_box {
		width: 12vw;
		height: 12vw;
		float: left;

	}

	.text_box {
		width: 60%;
		height: 12vw;
		float: left;
		margin-left: 5%;
	}
</style>
